package enumerate_try;

public enum Role {
    WARRIOR("战士", 100, 50, 30),
    MAGE("法师", 80, 70, 20),
    PRIEST("牧师", 60, 30, 50);

    private final String name; // 角色名称
    private int hp; // 角色血量
    private final int attack; // 角色攻击力
    private final int defense; // 角色防御力

    // 构造方法
    private Role(String name, int hp, int attack, int defense) {
        this.name = name;
        this.hp = hp;
        this.attack = attack;
        this.defense = defense;
    }

    // getter方法
    public String getName() {
        return name;
    }

    public int getHp() {
        return hp;
    }

    public int getAttack() {
        return attack;
    }

    public int getDefense() {
        return defense;
    }

    public void setHp(int newHp) {
        this.hp = newHp;
    }
}